(function(ValidatorName) {
	var mainValidator;
	function initValidatorConfig() {
		if ($.Config == null) {
			$.Config = {}
		}
		if ($.Config.isFocus == null) {
			$.Config.isFocus = false
		}
		if ($.Config.registerType == null) {
			$.Config.registerType = Global.registerType.ADD_FORM
		}
		if ($.Config.titleSepartor == null) {
			$.Config.titleSepartor = ","
		}
		if ($.Config.validateTitle == null) {
			$.Config.validateTitle = "{id}_title"
		}
		if ($.Config.validateProperty == null) {
			$.Config.validateProperty = "validate"
		}
		if ($.Config.isManyErrorMessage == null) {
			$.Config.isManyErrorMessage = true
		}
		if ($.Config.showErrorType == null) {
			$.Config.showErrorType = Global.alertType.MESSAGE_TYPE_ALERT
		}
		if ($.Config.enableSubValidator == null) {
			$.Config.enableSubValidator = Global.subValidator.enabled
		}
		if ($.Config.alert == null || !$.Config.alert instanceof Function) {
			$.Config.alert = function(msg) {
				window.alert(msg)
			}
		}
	}
	jValidator = $ = function(isMainValidator) {
		initValidatorConfig();
		this._vid = new Date().getTime() + "V"
				+ Math.round(Math.random() * 1000);
		var fieldNotEmptys;
		var fieldNotBlanks;
		var fieldNumbers;
		var fieldIntegers;
		var fieldNIntegers;
		var fieldFloats;
		var fieldNFloats;
		var fieldCustomNumbers;
		var fieldEnglishs;
		var fieldEngAndNums;
		var fieldLetterWords;
		var fieldMaxByteLengths;
		var fieldMaxLengths;
		var fieldMinLengths;
		var fieldBetweenLengths;
		var fieldBetweenByteLengths;
		var fieldEmails;
		var fieldURLs;
		var fieldDateCompares;
		var fieldMustSelectes;
		var fieldRegulars;
		var fieldCustomFunctions;
		var fieldValidators;
		if (isMainValidator) {
			mainValidator = this
		}
		this.isMain = function() {
			return (isMainValidator == null ? false : isMainValidator)
		};
		var _registerType = $.Config.registerType;
		this.registerType = function(type) {
			if (type == null) {
				return _registerType
			} else {
				_registerType = type
			}
		}
	};
	$.Config = {};
	$.getVersion = function() {
		return "2.1"
	};
	$.getMainValidator = function(isNew) {
		if (mainValidator == null && isNew === true) {
			new jValidator(true)
		}
		return mainValidator
	};
	window[ValidatorName == null ? "Validator" : ValidatorName] = $;
	$.Global = Global;
	$.prototype.validate = function(errorPanelId) {
		var isSuccess = false;
		var throwError = true;
		try {
			this.validateNotEmpty(errorPanelId, throwError);
			this.validateNotBlank(errorPanelId, throwError);
			this.validateMustSelected(errorPanelId, throwError);
			this.validateInteger(errorPanelId, throwError);
			this.validateNInteger(errorPanelId, throwError);
			this.validateNumber(errorPanelId, throwError);
			this.validateFloat(errorPanelId, throwError);
			this.validateNFloat(errorPanelId, throwError);
			this.validateCustomNumber(errorPanelId, throwError);
			this.validateWordChar(errorPanelId, throwError);
			this.validateEngAndNum(errorPanelId, throwError);
			this.validateEnglish(errorPanelId, throwError);
			this.validateEmail(errorPanelId, throwError);
			this.validateUrl(errorPanelId, throwError);
			this.validateMinLength(errorPanelId, throwError);
			this.validateMaxLength(errorPanelId, throwError);
			this.validateMaxByteLength(errorPanelId, throwError);
			this.validateBetweenLength(errorPanelId, throwError);
			this.validateBetweenByteLength(errorPanelId, throwError);
			this.validateRegular(errorPanelId, throwError);
			this.validateCustomFunction(errorPanelId, throwError);
			if (this.fieldValidators != null) {
				for ( var i = 0; i < this.fieldValidators.length; i++) {
					if (this.fieldValidators[i].validate(errorPanelId,
							throwError) == false) {
						throw new Error(
								Global.exception.EXCEPTION_VALIDATE_STOP)
					}
				}
			}
			isSuccess = true
		} catch (E) {
			if (E.message != Global.exception.EXCEPTION_VALIDATE_STOP) {
				throw E
			}
		} finally {
			return isSuccess
		}
	};
	$.prototype.validateNotEmpty = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isEmpty,
			validateFields : this.fieldNotEmptys,
			messageName : Global.message.NOT_EMPTY_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addNotEmpty = function(fields) {
		if (this.fieldNotEmptys == null) {
			this.fieldNotEmptys = []
		}
		this.addValidFiled(this.fieldNotEmptys, fields)
	};
	$.prototype.removeNotEmpty = function(ids) {
		this.removeFileds(this.fieldNotEmptys, "id", ids)
	};
	$.prototype.isEmpty = function(value) {
		return (value == null || value == "")
	};
	$.prototype.isNotEmpty = function(value) {
		return !this.isEmpty(value)
	};
	$.prototype.validateNotBlank = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isBlank,
			validateFields : this.fieldNotBlanks,
			messageName : Global.message.NOT_BLANK_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addNotBlank = function(fields) {
		if (this.fieldNotBlanks == null) {
			this.fieldNotBlanks = []
		}
		this.addValidFiled(this.fieldNotBlanks, fields)
	};
	$.prototype.removeNotBlank = function(ids) {
		this.removeFileds(this.fieldNotBlanks, "id", ids)
	};
	$.prototype.isBlank = function(value) {
		return Global.regExpPattern.checkIsBlank.test(value)
	};
	$.prototype.isNotBlank = function(value) {
		return !this.isBlank(value)
	};
	$.prototype.validateInteger = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotInteger,
			validateFields : this.fieldIntegers,
			messageName : Global.message.INTEGER_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addInteger = function(fields) {
		if (this.fieldIntegers == null) {
			this.fieldIntegers = []
		}
		this.addValidFiled(this.fieldIntegers, fields)
	};
	$.prototype.removeInteger = function(ids) {
		this.removeFileds(this.fieldIntegers, "id", ids)
	};
	$.prototype.isInteger = function(value) {
		return Global.regExpPattern.checkInteger.test(value)
	};
	$.prototype.isNotInteger = function(value) {
		return !this.isInteger(value)
	};
	$.prototype.validateNInteger = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotNInteger,
			validateFields : this.fieldNIntegers,
			messageName : Global.message.NINTEGER_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addNInteger = function(fields) {
		if (this.fieldNIntegers == null) {
			this.fieldNIntegers = []
		}
		this.addValidFiled(this.fieldNIntegers, fields)
	};
	$.prototype.removeNInteger = function(ids) {
		this.removeFileds(this.fieldNIntegers, "id", ids)
	};
	$.prototype.isNInteger = function(value) {
		return Global.regExpPattern.checkNInteger.test(value)
	};
	$.prototype.isNotNInteger = function(value) {
		return !this.isNInteger(value)
	};
	$.prototype.validateNumber = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotNumber,
			validateFields : this.fieldNumbers,
			messageName : Global.message.NUMBER_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addNumber = function(fields) {
		if (this.fieldNumbers == null) {
			this.fieldNumbers = []
		}
		this.addValidFiled(this.fieldNumbers, fields)
	};
	$.prototype.removeNumber = function(ids) {
		this.removeFileds(this.fieldNumbers, "id", ids)
	};
	$.prototype.isNumber = function(value) {
		return (value == "" || Global.regExpPattern.checkNumber.test(value))
	};
	$.prototype.isNotNumber = function(value) {
		return !this.isNumber(value)
	};
	$.prototype.validateFloat = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotFloat,
			validateFields : this.fieldFloats,
			messageName : Global.message.FLOAT_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addFloat = function(fields) {
		if (this.fieldFloats == null) {
			this.fieldFloats = []
		}
		this.addValidFiled(this.fieldFloats, fields)
	};
	$.prototype.removeFloat = function(ids) {
		this.removeFileds(this.fieldFloats, "id", ids)
	};
	$.prototype.isFloat = function(value) {
		return (value == "" || Global.regExpPattern.checkFloat.test(value))
	};
	$.prototype.isNotFloat = function(value) {
		return !this.isFloat(value)
	};
	$.prototype.validateNFloat = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotNFloat,
			validateFields : this.fieldNFloats,
			messageName : Global.message.NFLOAT_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addNFloat = function(fields) {
		if (this.fieldNFloats == null) {
			this.fieldNFloats = []
		}
		this.addValidFiled(this.fieldNFloats, fields)
	};
	$.prototype.removeNFloat = function(ids) {
		this.removeFileds(this.fieldNFloats, "id", ids)
	};
	$.prototype.isNFloat = function(value) {
		return (value == "" || Global.regExpPattern.checkNFloat.test(value))
	};
	$.prototype.isNotNFloat = function(value) {
		return !this.isNFloat(value)
	};
	$.prototype.validateCustomNumber = function(errorPanelId, isThrowError) {
		if (this.fieldCustomNumbers == null) {
			return true
		}
		for ( var i = 0; i < this.fieldCustomNumbers.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_REGEX_PATTERN,
						validateFields : [ this.fieldCustomNumbers[i] ],
						messageName : Global.message.CUSTOM_NUMBER_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addCustomNumber = function(fields) {
		if (this.fieldCustomNumbers == null) {
			this.fieldCustomNumbers = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				isNegative : fieldArray[i].isNegative,
				intMax : fieldArray[i].intMax,
				floatMax : fieldArray[i].floatMax,
				msgArgs : fieldArray[i].msgArgs,
				regExpPattern : null
			};
			var pattern;
			if (Global.regExpPattern.checkNInteger.test(field.intMax)
					&& Global.regExpPattern.checkNInteger.test(field.floatMax)) {
				pattern = "[\\d]{1," + field.intMax + "})([.]{1,1}[\\d]{1,"
						+ field.floatMax + "})?"
			} else {
				pattern = "[\\d]{1," + field.intMax + "})"
			}
			field.regExpPattern = new RegExp((field.isNegative ? "^(([-]?"
					: "^((")
					+ pattern + ")?$");
			this.addValidFiled(this.fieldCustomNumbers, field)
		}
	};
	$.prototype.removeCustomNumber = function(ids) {
		this.removeFileds(this.fieldCustomNumbers, "id", ids)
	};
	$.prototype.isCustomNumber = function(ruleArg, value) {
		var pattern;
		if (Global.regExpPattern.checkNInteger.test(ruleArg.intMax)
				&& Global.regExpPattern.checkNInteger.test(ruleArg.floatMax)) {
			pattern = "[\\d]{1," + ruleArg.intMax + "})([.]{1,1}[\\d]{1,"
					+ ruleArg.floatMax + "})?"
		} else {
			pattern = "[\\d]{1," + ruleArg.intMax + "})"
		}
		var customNumberRegExp = new RegExp((ruleArg.isNegative ? "^(([-]?"
				: "^((")
				+ pattern + ")?$");
		return (value == "" || customNumberRegExp.test(value))
	};
	$.prototype.isNotCustomNumber = function(ruleArg, value) {
		return !this.isCustomNumber(ruleArg, value)
	};
	$.prototype.validateRegular = function(errorPanelId, isThrowError) {
		if (this.fieldRegulars == null) {
			return true
		}
		for ( var i = 0; i < this.fieldRegulars.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_REGEX_PATTERN,
						validateFields : [ this.fieldRegulars[i] ],
						messageName : Global.message.REGULAR_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addRegular = function(fields) {
		if (this.fieldRegulars == null) {
			this.fieldRegulars = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				msgArgs : fieldArray[i].msgArgs,
				regExpPattern : fieldArray[i].rule
			};
			this.addValidFiled(this.fieldRegulars, field)
		}
	};
	$.prototype.removeRegular = function(ids) {
		this.removeFileds(this.fieldRegulars, "id", ids)
	};
	$.prototype.isRegular = function(rule, value) {
		return rule.test(value)
	};
	$.prototype.isNotRegular = function(rule, value) {
		return !this.isRegular(rule, value)
	};
	$.prototype.validateWordChar = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotWordChar,
			validateFields : this.fieldWordChars,
			messageName : Global.message.WORD_CHAR_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addWordChar = function(fields) {
		if (this.fieldWordChars == null) {
			this.fieldWordChars = []
		}
		this.addValidFiled(this.fieldWordChars, fields)
	};
	$.prototype.removeWordChar = function(ids) {
		this.removeFileds(this.fieldWordChars, "id", ids)
	};
	$.prototype.isWordChar = function(value) {
		return (Global.regExpPattern.checkWordChar.test(value))
	};
	$.prototype.isNotWordChar = function(value) {
		return !this.isWordChar(value)
	};
	$.prototype.validateEngAndNum = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotEngAndNum,
			validateFields : this.fieldEngAndNums,
			messageName : Global.message.ENG_AND_NUM_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addEngAndNum = function(fields) {
		if (this.fieldEngAndNums == null) {
			this.fieldEngAndNums = []
		}
		this.addValidFiled(this.fieldEngAndNums, fields)
	};
	$.prototype.removeEngAndNum = function(ids) {
		this.removeFileds(this.fieldEngAndNums, "id", ids)
	};
	$.prototype.isEngAndNum = function(value) {
		return (Global.regExpPattern.checkEngAndNum.test(value))
	};
	$.prototype.isNotEngAndNum = function(value) {
		return !this.isEngAndNum(value)
	};
	$.prototype.validateEnglish = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotEnglish,
			validateFields : this.fieldEnglishs,
			messageName : Global.message.ENGLISH_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addEnglish = function(fields) {
		if (this.fieldEnglishs == null) {
			this.fieldEnglishs = []
		}
		this.addValidFiled(this.fieldEnglishs, fields)
	};
	$.prototype.removeEnglish = function(ids) {
		this.removeFileds(this.fieldEnglishs, "id", ids)
	};
	$.prototype.isEnglish = function(value) {
		return (Global.regExpPattern.checkEnglish.test(value))
	};
	$.prototype.isNotEnglish = function(value) {
		return !this.isEnglish(value)
	};
	$.prototype.validateMinLength = function(errorPanelId, isThrowError) {
		if (this.fieldMinLengths == null) {
			return true
		}
		for ( var i = 0; i < this.fieldMinLengths.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION,
						validateFunc : this.isNotMinLength,
						validateFields : [ this.fieldMinLengths[i] ],
						messageName : Global.message.MIN_LENGTH_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addMinLength = function(fields) {
		if (this.fieldMinLengths == null) {
			this.fieldMinLengths = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				min : (fieldArray[i].min == null ? fieldArray[i].minLength
						: fieldArray[i].min),
				msgArgs : (typeof (fieldArray[i].msgArgs) == "string" ? [ fieldArray[i].msgArgs ]
						: fieldArray[i].msgArgs)
			};
			this.addValidFiled(this.fieldMinLengths, field)
		}
	};
	$.prototype.removeMinLength = function(ids) {
		this.removeFileds(this.fieldMinLengths, "id", ids)
	};
	$.prototype.isMinLength = function(args1, args2) {
		if (args2 == null && !(args1 instanceof String)) {
			args1.min = (args1.min == null ? args1.minLength : args1.min);
			return document.getElementById(args1.id).value.length >= args1.min
		} else {
			return args1.length >= args2
		}
	};
	$.prototype.isNotMinLength = function(args1, args2) {
		return !this.isMinLength(args1, args2)
	};
	$.prototype.validateMaxLength = function(errorPanelId, isThrowError) {
		if (this.fieldMaxLengths == null) {
			return true
		}
		for ( var i = 0; i < this.fieldMaxLengths.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION,
						validateFunc : this.isNotMaxLength,
						validateFields : [ this.fieldMaxLengths[i] ],
						messageName : Global.message.MAX_LENGTH_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addMaxLength = function(fields) {
		if (this.fieldMaxLengths == null) {
			this.fieldMaxLengths = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				max : (fieldArray[i].max == null ? fieldArray[i].maxLength
						: fieldArray[i].max),
				msgArgs : (typeof (fieldArray[i].msgArgs) == "string" ? [ fieldArray[i].msgArgs ]
						: fieldArray[i].msgArgs)
			};
			this.addValidFiled(this.fieldMaxLengths, field)
		}
	};
	$.prototype.removeMaxLength = function(ids) {
		this.removeFileds(this.fieldMaxLengths, "id", ids)
	};
	$.prototype.isMaxLength = function(args1, args2) {
		if (args2 == null && !(args1 instanceof String)) {
			return document.getElementById(args1.id).value.length <= (args1.max == null ? args1.maxLength
					: args1.max)
		} else {
			return args1.length <= args2
		}
	};
	$.prototype.isNotMaxLength = function(args1, args2) {
		return !this.isMaxLength(args1, args2)
	};
	$.prototype.validateMaxByteLength = function(errorPanelId, isThrowError) {
		if (this.fieldMaxByteLengths == null) {
			return true
		}
		for ( var i = 0; i < this.fieldMaxByteLengths.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION,
						validateFunc : this.isNotMaxByteLength,
						validateFields : [ this.fieldMaxByteLengths[i] ],
						messageName : Global.message.MAX_BYTE_LENGTH_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addMaxByteLength = function(fields) {
		if (this.fieldMaxByteLengths == null) {
			this.fieldMaxByteLengths = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				max : (fieldArray[i].max == null ? fieldArray[i].maxLength
						: fieldArray[i].max),
				msgArgs : (typeof (fieldArray[i].msgArgs) == "string" ? [ fieldArray[i].msgArgs ]
						: fieldArray[i].msgArgs)
			};
			this.addValidFiled(this.fieldMaxByteLengths, field)
		}
	};
	$.prototype.removeMaxByteLength = function(ids) {
		this.removeFileds(this.fieldMaxByteLengths, "id", ids)
	};
	$.prototype.isMaxByteLength = function(args1, args2) {
		var value = "";
		var maxLength = 0;
		if (args2 == null && !(args1 instanceof String)) {
			value = document.getElementById(args1.id).value;
			maxLength = (args1.max == null ? args1.maxLength : args1.max)
		} else {
			value = args1.length;
			maxLength = args2
		}
		if (value.length > maxLength) {
			return false
		}
		var size = 0;
		for ( var i = 0; i < value.length; i++) {
			if (value.charCodeAt(i) > 127) {
				size += 2
			} else {
				size++
			}
		}
		return size <= maxLength
	};
	$.prototype.isNotMaxByteLength = function(args1, args2) {
		return !this.isMaxByteLength(args1, args2)
	};
	$.prototype.validateBetweenLength = function(errorPanelId, isThrowError) {
		if (this.fieldBetweenLengths == null) {
			return true
		}
		for ( var i = 0; i < this.fieldBetweenLengths.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION,
						validateFunc : this.isNotBetweenLength,
						validateFields : [ this.fieldBetweenLengths[i] ],
						messageName : Global.message.BETWEEN_LENGTH_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addBetweenLength = function(fields) {
		if (this.fieldBetweenLengths == null) {
			this.fieldBetweenLengths = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				min : (fieldArray[i].min == null ? fieldArray[i].minLength
						: fieldArray[i].min),
				max : (fieldArray[i].max == null ? fieldArray[i].maxLength
						: fieldArray[i].max),
				msgArgs : (typeof (fieldArray[i].msgArgs) == "string" ? [ fieldArray[i].msgArgs ]
						: fieldArray[i].msgArgs)
			};
			this.addValidFiled(this.fieldBetweenLengths, field)
		}
	};
	$.prototype.removeBetweenLength = function(ids) {
		this.removeFileds(this.fieldBetweenLengths, "id", ids)
	};
	$.prototype.isBetweenLength = function(args) {
		var length = document.getElementById(args.id).value.length;
		args.min = (args.min == null ? args.minLength : args.min);
		args.max = (args.max == null ? args.maxLength : args.max);
		return (length >= args.min && length <= args.max)
	};
	$.prototype.isNotBetweenLength = function(args1, args2) {
		return !this.isBetweenLength(args1, args2)
	};
	$.prototype.validateBetweenByteLength = function(errorPanelId, isThrowError) {
		if (this.fieldBetweenByteLengths == null) {
			return true
		}
		for ( var i = 0; i < this.fieldBetweenByteLengths.length; i++) {
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION,
						validateFunc : this.isNotBetweenByteLength,
						validateFields : [ this.fieldBetweenByteLengths[i] ],
						messageName : Global.message.BETWEEN_BYTE_LENGTH_ERROR_MESSAGE,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addBetweenByteLength = function(fields) {
		if (this.fieldBetweenByteLengths == null) {
			this.fieldBetweenByteLengths = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {
				id : fieldArray[i].id,
				title : fieldArray[i].title,
				min : (fieldArray[i].min == null ? fieldArray[i].minLength
						: fieldArray[i].min),
				max : (fieldArray[i].max == null ? fieldArray[i].maxLength
						: fieldArray[i].max),
				msgArgs : fieldArray[i].msgArgs
			};
			this.addValidFiled(this.fieldBetweenByteLengths, field)
		}
	};
	$.prototype.removeBetweenByteLength = function(ids) {
		this.removeFileds(this.fieldBetweenByteLengths, "id", ids)
	};
	$.prototype.isBetweenByteLength = function(args) {
		var value = document.getElementById(args.id).value;
		args.max = (args.max == null ? args.maxLength : args.max);
		if (value.length > args.max) {
			return false
		}
		var length = 0;
		for ( var i = 0; i < value.length; i++) {
			if (value.charCodeAt(i) > 127) {
				length += 2
			} else {
				length++
			}
		}
		args.min = (args.min == null ? args.minLength : args.min);
		return (length >= args.min && length <= args.max)
	};
	$.prototype.isNotBetweenByteLength = function(args1, args2) {
		return !this.isBetweenByteLength(args1, args2)
	};
	$.prototype.validateMustSelected = function(errorPanelId, isThrowError) {
		var isSuccess = true;
		if (this.fieldMustSelecteds == null) {
			return isSuccess
		}
		this.cleanAllMessage({
			errorPanelId : errorPanelId,
			fields : this.fieldMustSelecteds
		});
		var fieldsName = [];
		if (this.fieldMustSelecteds != null) {
			var fieldsMessage = [];
			var fieldsMessageArgs = [];
			for ( var i = 0; i < this.fieldMustSelecteds.length; i++) {
				if (this.isNotMustSelected(this.fieldMustSelecteds[i])) {
					fieldsName.push(this.fieldMustSelecteds[i].name);
					fieldsMessage.push(this.fieldMustSelecteds[i].title);
					fieldsMessageArgs.push(this.fieldMustSelecteds[i].msgArgs)
				}
			}
			this.showMessage({
				fieldNames : fieldsName,
				messages : this.getErrorMessage(
						Global.message.MUST_SELECTED_ERROR_MESSAGE,
						fieldsMessage, fieldsMessageArgs),
				errorPanelId : errorPanelId
			});
			if (fieldsMessage.length > 0) {
				isSuccess = false;
				if ($.Config.isFocus) {
					doFocus(document.getElementsByName(fieldsName[0])[0])
				}
				if (isThrowError === true) {
					throw new Error(Global.exception.EXCEPTION_VALIDATE_STOP)
				}
			}
		}
		return isSuccess
	};
	$.prototype.addMustSelected = function(fields) {
		if (this.fieldMustSelecteds == null) {
			this.fieldMustSelecteds = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			if (typeof (fieldArray[i]) == "string") {
				fieldArray[i] = {
					name : fieldArray[i]
				}
			}
			var field = {
				name : fieldArray[i].name,
				title : fieldArray[i].title,
				defaultValue : fieldArray[i].defaultValue
			};
			this.addValidFiled(this.fieldMustSelecteds, field)
		}
	};
	$.prototype.removeMustSelected = function(names) {
		this.removeFileds(this.fieldMustSelecteds, "name", names)
	};
	$.prototype.isMustSelected = function(args) {
		var objFileds = document.getElementsByName(args.name);
		var checkResult = false;
		if (objFileds.length > 0) {
			var prop = "value";
			var value = args.defaultValue ? args.defaultValue : "";
			if (objFileds[0].tagName == "INPUT") {
				prop = "checked";
				value = false
			}
			for ( var i = 0; i < objFileds.length; i++) {
				if (objFileds[i][prop] != value) {
					checkResult = true
				}
			}
		}
		return checkResult
	};
	$.prototype.isNotMustSelected = function(args) {
		return !this.isMustSelected(args)
	};
	$.prototype.validateEmail = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotEmail,
			validateFields : this.fieldEmails,
			messageName : Global.message.EMAIL_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addEmail = function(fields) {
		if (this.fieldEmails == null) {
			this.fieldEmails = []
		}
		this.addValidFiled(this.fieldEmails, fields)
	};
	$.prototype.removeEmail = function(ids) {
		this.removeFileds(this.fieldEmails, "id", ids)
	};
	$.prototype.isEmail = function(value) {
		return (value == "" || Global.regExpPattern.checkEmail.test(value))
	};
	$.prototype.isNotEmail = function(value) {
		return !this.isEmail(value)
	};
	$.prototype.validateUrl = function(errorPanelId, isThrowError) {
		return this.validateFields({
			validateType : Global.validateMethodType.VALIDATE_TYPE_FUNCTION,
			validateFunc : this.isNotURL,
			validateFields : this.fieldURLs,
			messageName : Global.message.URL_ERROR_MESSAGE,
			errorPanelId : errorPanelId,
			isThrowError : isThrowError
		})
	};
	$.prototype.addUrl = function(fields) {
		if (this.fieldURLs == null) {
			this.fieldURLs = []
		}
		this.addValidFiled(this.fieldURLs, fields)
	};
	$.prototype.removeUrl = function(ids) {
		this.removeFileds(this.fieldURLs, "id", ids)
	};
	$.prototype.isUrl = function(value) {
		return (value == "" || Global.regExpPattern.checkURL.test(value))
	};
	$.prototype.isNotUrl = function(value) {
		return !this.isUrl(value)
	};
	$.prototype.validateCustomFunction = function(errorPanelId, isThrowError) {
		if (this.fieldCustomFunctions == null) {
			return true
		}
		for ( var i = 0; i < this.fieldCustomFunctions.length; i++) {
			var msgCode = this.fieldCustomFunctions[i].msgCode;
			if (msgCode == null) {
				msgCode = Global.message.CUSTOM_FUNCTION_ERROR_MESSAGE
			}
			var isSuccess = this
					.validateFields({
						validateType : Global.validateMethodType.VALIDATE_TYPE_CUSTOM_FUNCTION,
						validateFunc : this.fieldCustomFunctions[i].func,
						validateFields : [ this.fieldCustomFunctions[i] ],
						messageName : msgCode,
						errorPanelId : errorPanelId,
						isThrowError : isThrowError
					});
			if (!isSuccess) {
				return false
			}
		}
		return true
	};
	$.prototype.addCustomFunction = function(fields) {
		if (this.fieldCustomFunctions == null) {
			this.fieldCustomFunctions = []
		}
		var fieldArray;
		if (fields instanceof Array) {
			fieldArray = fields
		} else {
			fieldArray = [ fields ]
		}
		for ( var i = 0; i < fieldArray.length; i++) {
			var field = {};
			for ( var p in fieldArray[i]) {
				field[p] = fieldArray[i][p]
			}
			this.addValidFiled(this.fieldCustomFunctions, field)
		}
	};
	$.prototype.removeCustomFunction = function(ids) {
		this.removeFileds(this.fieldCustomFunctions, "id", ids)
	};
	$.prototype.addSubValidator = function(validator) {
		if ($.Config.enableSubValidator === Global.subValidator.enabled) {
			if (validator instanceof jValidator && !validator.isMain()
					&& validator != this) {
				if (this.fieldValidators == null) {
					this.fieldValidators = []
				}
				var _vid = "|";
				for ( var i = 0; i < this.fieldValidators.length; i++) {
					_vid += (this.fieldValidators[i]._vid + "|")
				}
				if (_vid.indexOf("|" + validator._vid + "|") < 0) {
					this.fieldValidators.push(validator);
					return true
				}
			}
		}
		return false
	};
	$.newFormValidator = function(formId) {
		if ($.Config.registerType == Global.registerType.FORM
				|| $.Config.registerType == Global.registerType.ADD_FORM) {
			var validator = new $(true);
			try {
				validator.registerType(Global.registerType.ADD_FORM);
				var formObject = document.getElementById(formId);
				for ( var i = 0; i < formObject.length; i++) {
					var validatePattern = null;
					if ($.Config.validateProperty == "class") {
						validatePattern = formObject[i].className;
						if (validatePattern == null || validatePattern == "") {
							continue
						}
						validatePattern = validatePattern.substring(
								validatePattern.indexOf("{"), validatePattern
										.lastIndexOf("}") + 1)
					} else {
						validatePattern = formObject[i]
								.getAttribute($.Config.validateProperty)
					}
					if (validatePattern == null || validatePattern == "") {
						continue
					}
					var validatePatternObject = null;
					try {
						eval("validatePatternObject = " + validatePattern)
					} catch (E) {
						var errorMessage = "解析验证规则错误，控件为[id="
								+ formObject[i].id + ", name="
								+ formObject[i].name + "]。\n规则为："
								+ validatePattern + "\n错误信息：" + E.message;
						alert(errorMessage);
						continue
					}
					validatePatternObject.id = formObject[i].id;
					validatePatternObject.name = formObject[i].name;
					if (validatePatternObject.notEmpty === true) {
						validator.addNotEmpty({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.notBlank === true) {
						validator.addNotBlank({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.integer === true) {
						validator.addInteger({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.nInteger === true) {
						validator.addNInteger({
							id : formObject[i].id
						})
					}
					if (validatePatternObject["float"] === true) {
						validator.addFloat({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.nFloat === true) {
						validator.addNFloat({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.number === true) {
						validator.addNumber({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.email === true) {
						validator.addEmail({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.engAndNum === true) {
						validator.addEngAndNum({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.english === true) {
						validator.addEnglish({
							id : formObject[i].id
						})
					}
					if (validatePatternObject.url === true) {
						validator.addUrl({
							id : validatePatternObject.id,
							msgArgs : validatePatternObject.msgArgs
						})
					}
					if (validatePatternObject.wordChar === true) {
						validator.addWordChar({
							id : validatePatternObject.id,
							msgArgs : validatePatternObject.msgArgs
						})
					}
					if (validatePatternObject.maxByteLength instanceof Object) {
						validatePatternObject.maxByteLength.id = validatePatternObject.id;
						validator
								.addMaxByteLength(validatePatternObject.maxByteLength)
					}
					if (validatePatternObject.maxLength instanceof Object) {
						validatePatternObject.maxLength.id = validatePatternObject.id;
						validator.addMaxLength(validatePatternObject.maxLength)
					}
					if (validatePatternObject.minLength instanceof Object) {
						validatePatternObject.minLength.id = validatePatternObject.id;
						validator.addMinLength(validatePatternObject.minLength)
					}
					if (validatePatternObject.betweenByteLength instanceof Object) {
						validatePatternObject.betweenByteLength.id = validatePatternObject.id;
						validator
								.addBetweenByteLength(validatePatternObject.betweenByteLength)
					}
					if (validatePatternObject.betweenLength instanceof Object) {
						validatePatternObject.betweenLength.id = validatePatternObject.id;
						validator
								.addBetweenLength(validatePatternObject.betweenLength)
					}
					if (validatePatternObject.mustSelected === true) {
						validator.addMustSelected({
							name : validatePatternObject.name
						})
					} else {
						if (validatePatternObject.mustSelected instanceof Object) {
							validatePatternObject.mustSelected.name = validatePatternObject.name;
							validator
									.addMustSelected(validatePatternObject.mustSelected)
						}
					}
					if (validatePatternObject.regular instanceof Object) {
						validatePatternObject.regular.id = validatePatternObject.id;
						validatePatternObject.regular.name = validatePatternObject.name;
						validator.addRegular(validatePatternObject.regular)
					}
					if (validatePatternObject.customFunction instanceof Object) {
						validatePatternObject.customFunction.id = validatePatternObject.id;
						validator
								.addCustomFunction(validatePatternObject.customFunction)
					}
					if (validatePatternObject.customNumber instanceof Object) {
						validatePatternObject.customNumber.id = validatePatternObject.id;
						validator
								.addCustomNumber(validatePatternObject.customNumber)
					}
				}
			} finally {
				validator.registerType($.Config.registerType);
				return validator
			}
		} else {
			alert(Global.errorCode.E001);
			return null
		}
	};
	$.prototype.validateFields = function(args) {
		this.cleanAllMessage({
			errorPanelId : args.errorPanelId,
			fields : args.validateFields
		});
		var isSuccess = true;
		if (args.validateFields != null) {
			var fieldsId = [];
			var fieldsMessage = [];
			var fieldsMessageArgs = [];
			for ( var i = 0; i < args.validateFields.length; i++) {
				var value = document.getElementById(args.validateFields[i].id).value;
				if ((args.validateType == Global.validateMethodType.VALIDATE_TYPE_FUNCTION && args.validateFunc
						.call(this, value))
						|| (args.validateType == Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION && args.validateFunc
								.call(this, args.validateFields[i]))
						|| (args.validateType == Global.validateMethodType.VALIDATE_TYPE_CUSTOM_FUNCTION && !args.validateFunc
								.call(this, args.validateFields[i]))
						|| (args.validateType == Global.validateMethodType.VALIDATE_TYPE_REGEX_PATTERN && !args.validateFields[i].Global.regExpPattern
								.test(value))) {
					fieldsId.push(args.validateFields[i].id);
					fieldsMessage.push(args.validateFields[i].title);
					fieldsMessageArgs.push(args.validateFields[i].msgArgs)
				}
			}
			var isCustom = (args.validateType == Global.validateMethodType.VALIDATE_TYPE_REGEX_PATTERN
					|| args.validateType == Global.validateMethodType.VALIDATE_TYPE_SPECIAL_FUNCTION || args.validateType == Global.validateMethodType.VALIDATE_TYPE_CUSTOM_FUNCTION);
			this.showMessage({
				fieldIds : fieldsId,
				messages : this.getErrorMessage(args.messageName,
						fieldsMessage, fieldsMessageArgs, isCustom),
				errorPanelId : args.errorPanelId
			});
			if (fieldsMessage.length > 0) {
				isSuccess = false;
				if ($.Config.isFocus) {
					doFocus(fieldsId[0])
				}
				if (args.isThrowError === true) {
					throw new Error(Global.exception.EXCEPTION_VALIDATE_STOP)
				}
			}
		}
		return isSuccess
	};
	$.prototype.addValidFiled = function(checkArrayTypes, fields) {
		if (this.registerType() == Global.registerType.ADD
				|| this.registerType() == Global.registerType.ADD_FORM) {
			if (fields instanceof Array) {
				for ( var i = 0; i < fields.length; i++) {
					if (typeof (fields[i]) == "string") {
						fields[i] = {
							id : fields[i]
						}
					}
					paddingFieldTitle(fields[i]);
					checkArrayTypes.push(fields[i])
				}
			} else {
				if (typeof (fields) == "string") {
					fields = {
						id : fields
					}
				}
				paddingFieldTitle(fields);
				checkArrayTypes.push(fields)
			}
		} else {
			alert(Global.errorCode.E002)
		}
	};
	$.prototype.removeFileds = function(fieldsArray, idName, idsValue) {
		if (idsValue instanceof Array) {
			for ( var i = 0; i < idsValue.length; i++) {
				this.removeFiled(fieldsArray, idName, idsValue[i])
			}
		} else {
			this.removeFiled(fieldsArray, "id", idsValue)
		}
	};
	$.prototype.removeFiled = function(fieldsArray, idName, idValue) {
		if (fieldsArray == null) {
			return
		}
		var index = -1;
		for ( var i = 0; i < fieldsArray.length; i++) {
			if (fieldsArray[i][idName] == idValue) {
				index = i;
				break
			}
		}
		if (index > -1) {
			fieldsArray.splice(index, 1)
		}
	};
	$.prototype.getErrorMessage = function(messageNameKey, messageLable,
			messageArgs, isCustom) {
		if (messageLable == null || messageLable.length == 0) {
			return null
		}
		var errorMessage = [];
		if ($.Config.isManyErrorMessage) {
			var message = (messageLable instanceof Array ? messageLable
					.join($.Config.titleSepartor) : messageLable);
			message = $.messages[messageNameKey].replace("{title}", message);
			if (isCustom) {
				if (messageArgs != null && messageArgs instanceof Array) {
					for ( var i = 0; i < messageArgs.length; i++) {
						if (messageArgs[i] == null) {
							errorMessage.push(message)
						} else {
							if (messageArgs[i] instanceof Array) {
								for ( var j = 0; j < messageArgs[i].length; j++) {
									message = message.replace("{" + j + "}",
											(messageArgs[i][j] == null ? ""
													: messageArgs[i][j]))
								}
							} else {
								message = message
										.replace("{0}", messageArgs[i])
							}
							errorMessage.push(message)
						}
					}
				}
			} else {
				errorMessage.push(message)
			}
		} else {
			var messages = (messageLable instanceof Array ? messageLable
					: new Array(messageLable));
			for ( var i = 0; i < messageLable.length; i++) {
				var message = $.messages[messageNameKey].replace("{title}",
						messages[i]);
				if (messageArgs[i] instanceof Array) {
					for ( var j = 0; j < messageArgs[i].length; j++) {
						message = message.replace("{" + j + "}",
								(messageArgs[i][j] == null ? ""
										: messageArgs[i][j]))
					}
					errorMessage.push(message)
				} else {
					errorMessage.push(message)
				}
			}
		}
		return errorMessage
	};
	$.prototype.showMessage = function(args) {
		if (args.messages == null || args.messages == "") {
			return
		}
		if ($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_STYLE) {
			if (args.fieldIds != null) {
				for ( var i = 0; i < args.fieldIds.length; i++) {
					var fieldObject = document.getElementById(args.fieldIds[i]);
					fieldObject.className = $.Config.errorMesssageClass;
					fieldObject.title = args.messages[i]
				}
			} else {
				if (args.fieldNames != null) {
					for ( var i = 0; i < args.fieldNames.length; i++) {
						var fieldObjects = document
								.getElementsByName(args.fieldNames[i]);
						for ( var j = 0; j < fieldObjects.length; j++) {
							fieldObjects[j].className = $.Config.errorMesssageClass;
							fieldObjects[j].title = args.messages[i]
						}
					}
				}
			}
		} else {
			if ($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_LABEL
					|| $.Config.showErrorType == Global.alertType.MESSAGE_TYPE_DIV) {
				var isFieldIds = (args.fieldNames == null);
				var fields = (isFieldIds ? args.fieldIds : args.fieldNames);
				for ( var i = 0; i < fields.length; i++) {
					var fieldObject = document.getElementById(fields[i]);
					if (fieldObject == null) {
						fieldObject = document.getElementsByName(fields[i]);
						for ( var foIndex = 0; foIndex < fieldObject.length; foIndex++) {
							fieldObject[foIndex].className = $.Config.errorMesssageClass
						}
					}
					var labelObject = document.getElementById(fields[i]
							+ "_$_error_message_label");
					if (labelObject == null) {
						var node = null;
						if (isFieldIds) {
							node = document.getElementById(fields[i])
						} else {
							var nodes = document.getElementsByName(fields[i]);
							node = nodes[nodes.length - 1]
						}
						var insertedNode = document
								.createElement($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_LABEL ? "label"
										: "div");
						insertedNode.appendChild(document
								.createTextNode(args.messages[i]));
						insertedNode.className = $.Config.errorMesssageClass;
						insertedNode.id = fields[i] + "_$_error_message_label";
						if (node.type == "checkbox" || node.type == "radio") {
							node.parentNode.appendChild(insertedNode)
						} else {
							node.parentNode.insertBefore(insertedNode,
									node.nextSibling)
						}
					} else {
						labelObject.innerText = args.messages[i];
						labelObject.style.display = ""
					}
				}
			} else {
				if ($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_PANLE) {
					var errorPanel = document.getElementById(args.errorPanelId);
					if (errorPanel == null) {
						alert("未找到显示信息区域对象！");
						return
					}
					errorPanel.innerHTML = "";
					var message = "<ul "
							+ ($.Config.errorMesssageClass == null ? ""
									: 'class="' + $.Config.errorMesssageClass
											+ '"') + ">";
					for ( var i = 0; i < args.messages.length; i++) {
						message += ("<li>" + args.messages[i] + "</li>")
					}
					message += "</ul>";
					errorPanel.innerHTML = message
				} else {
					var msg = args.messages instanceof Array ? args.messages
							.join("\n") : args.messages;
					$.Config.alert.call(this, msg)
				}
			}
		}
	};
	$.prototype.cleanAllMessage = function(args) {
		if (args.errorPanelId != null
				&& $.Config.showErrorType == Global.alertType.MESSAGE_TYPE_PANLE) {
			document.getElementById(args.errorPanelId).innerHTML = ""
		} else {
			if ($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_LABEL
					|| $.Config.showErrorType == Global.alertType.MESSAGE_TYPE_DIV) {
				if (args.fields != null) {
					for ( var i = 0; i < args.fields.length; i++) {
						var fieldId = (args.fields[i].name == null ? args.fields[i].id
								: args.fields[i].name);
						var fieldObject = document.getElementById(fieldId);
						if (fieldObject == null) {
							fieldObject = document.getElementsByName(fieldId);
							for ( var foIndex = 0; foIndex < fieldObject.length; foIndex++) {
								fieldObject[foIndex].className = ""
							}
						} else {
							fieldObject.className = ""
						}
						var labelObject = document.getElementById(fieldId
								+ "_$_error_message_label");
						if (labelObject != null) {
							labelObject.style.display = "none"
						}
					}
				}
			} else {
				if ($.Config.showErrorType == Global.alertType.MESSAGE_TYPE_STYLE) {
					if (args.fields != null) {
						for ( var i = 0; i < args.fields.length; i++) {
							if (args.fields[i].id == null) {
								var fieldObjects = document
										.getElementsByName(args.fields[i].name);
								for ( var j = 0; j < fieldObjects.length; j++) {
									resetClassAndTitle(fieldObjects[j])
								}
							} else {
								resetClassAndTitle(document
										.getElementById(args.fields[i].id))
							}
						}
					}
				}
			}
		}
	};
	function resetClassAndTitle(fieldObject) {
		if (fieldObject._oldClassName == null) {
			fieldObject._oldClassName = fieldObject.className
		}
		fieldObject.className = (fieldObject._oldClassName != null ? fieldObject._oldClassName
				: fieldObject.className
						.replace($.Config.errorMesssageClass, ""));
		fieldObject.title = ""
	}
	function paddingFieldTitle(field) {
		if (field.title == null) {
			var titleId = $.Config.validateTitle.replace("{id}",
					(field.id == null ? field.name : field.id));
			var titleObject = document.getElementById(titleId);
			field.title = (titleObject == null ? ""
					: (titleObject.innerText === undefined ? titleObject.textContent
							: titleObject.innerText))
		}
	}
	function doFocus(args) {
		try {
			if (typeof (args) == "string") {
				var obj = document.getElementById(args);
				if (obj.type != "hidden") {
					obj.focus()
				}
			} else {
				args.focus()
			}
		} catch (E) {
			if ($.Config.debug === true) {
				alert(E.message)
			}
		}
	}
	var Global = {
		registerType : {
			ADD : 0,
			FORM : 1,
			ADD_FORM : 2
		},
		subValidator : {
			enabled : true,
			disabled : false
		},
		alertType : {
			MESSAGE_TYPE_ALERT : 1,
			MESSAGE_TYPE_PANLE : 2,
			MESSAGE_TYPE_STYLE : 3,
			MESSAGE_TYPE_LABEL : 4,
			MESSAGE_TYPE_DIV : 5
		},
		message : {
			NOT_EMPTY_ERROR_MESSAGE : "checkNotEmpty",
			NOT_BLANK_ERROR_MESSAGE : "checkNotBlank",
			INTEGER_ERROR_MESSAGE : "checkInteger",
			NINTEGER_ERROR_MESSAGE : "checkNInteger",
			NUMBER_ERROR_MESSAGE : "checkNumber",
			FLOAT_ERROR_MESSAGE : "checkFloat",
			NFLOAT_ERROR_MESSAGE : "checkNFloat",
			CUSTOM_NUMBER_ERROR_MESSAGE : "checkCustomNumber",
			REGULAR_ERROR_MESSAGE : "checkRegular",
			WORD_CHAR_ERROR_MESSAGE : "checkWordChar",
			ENG_AND_NUM_ERROR_MESSAGE : "checkEngAndNum",
			ENGLISH_ERROR_MESSAGE : "checkEnglish",
			MIN_LENGTH_ERROR_MESSAGE : "checkMinLength",
			MAX_LENGTH_ERROR_MESSAGE : "checkMaxLength",
			MAX_BYTE_LENGTH_ERROR_MESSAGE : "checkMaxByteLength",
			BETWEEN_LENGTH_ERROR_MESSAGE : "checkBetweenLength",
			BETWEEN_BYTE_LENGTH_ERROR_MESSAGE : "checkBetweenByteLength",
			MUST_SELECTED_ERROR_MESSAGE : "checkMustSelected",
			CUSTOM_FUNCTION_ERROR_MESSAGE : "checkCustomFunction",
			EMAIL_ERROR_MESSAGE : "checkEmail",
			URL_ERROR_MESSAGE : "checkURL"
		},
		validateMethodType : {
			VALIDATE_TYPE_FUNCTION : "0",
			VALIDATE_TYPE_SPECIAL_FUNCTION : "1",
			VALIDATE_TYPE_CUSTOM_FUNCTION : "2",
			VALIDATE_TYPE_REGEX_PATTERN : "3"
		},
		regExpPattern : {
			checkIsBlank : /^(([\s]+)|([\s]*))$/,
			checkNumber : /^([-]?[\d]+)+([.]{1,1}[\d]+)?$/,
			checkInteger : /^([-]?[\d]+)?$/,
			checkNInteger : /^([\d]+)?$/,
			checkFloat : /^[-]?[\d]+[.]{1,1}[\d]+$/,
			checkNFloat : /^[\d]+[.]{1,1}[\d]+$/,
			checkEnglish : /^[a-zA-Z]*$/,
			checkEngAndNum : /^[0-9a-zA-Z]*$/,
			checkWordChar : /^[0-9_\- a-zA-Z]*$/,
			checkEmail : /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/,
			checkURL : /^(ftp|http|https):\/\/(([a-z0-9][-_a-z0-9]*)(\.[a-z0-9][-_a-z0-9]*)+)(:(\d+))?\/?/i
		},
		exception : {
			EXCEPTION_VALIDATE_STOP : "EXCEPTION_VALIDATE_STOP"
		},
		errorCode : {
			E001 : "ErrorCode: E001\n不支持表单控件生成模式，请联系管理员。",
			E002 : "ErrorCode: E002\n不支持添加规则模式，请联系管理员。"
		}
	}
})("Validator");